def calculate_sum(s):
    chars = "abcdefghijklmnopqrstuvwxyz"
    counter = 0
    for char in s:
        char = char.lower()
        if char.isdigit():
            counter += int(char)
        elif char in chars:
            counter += chars.index(char)
    return counter

while True:
    user_input = input("请输入一个字符串（输入 'exit' 或 'quit' 退出）：")
    if user_input.lower() in ['exit', 'quit']:
        break
    result = calculate_sum(user_input)
    print(f"转换后的结果是: {result}")
